package com.wxzz.elearing.livetelecast.api.server;

import com.wxzz.elearing.livetelecast.service.IPlatformLivetelecastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/livetelecast-api")
public class LivetelecastApi {

    @Autowired
    private IPlatformLivetelecastService platformLivetelecastService;

    /**
     * 根据讲师id查询直播时长
     *
     * @param docentId
     * @return
     */
    @RequestMapping(value = "selectPlatformLivetelecastTimeByDocentId/{docentId}", method = RequestMethod.POST)
    public Integer selectPlatformLivetelecastTimeByDocentId(@PathVariable Long docentId) {
        return platformLivetelecastService.selectPlatformLivetelecastTimeByDocentId(docentId);
    }

    /**
     * 根据讲师id查询直播数量
     *
     * @param docentId
     * @return
     */
    @RequestMapping(value = "selectPlatformLivetelecastNumByDocentId/{docentId}", method = RequestMethod.POST)
    public Integer selectPlatformLivetelecastNumByDocentId(@PathVariable Long docentId) {
        return platformLivetelecastService.selectPlatformLivetelecastNumByDocentId(docentId);
    }
}
